<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Pod::Simple::Subclassing -- write a formatter as a Pod::Simple subclass - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/Pod::Simple::Subclassing">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./Pod::Simple::Subclassing.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/Pod::Simple::Subclassing">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/Pod::Simple::Subclassing">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/Pod::Simple::Subclassing">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/Pod::Simple::Subclassing">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/Pod::Simple::Subclassing">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/Pod::Simple::Subclassing">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/Pod::Simple::Subclassing">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/Pod::Simple::Subclassing">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/Pod::Simple::Subclassing">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/Pod::Simple::Subclassing">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/Pod::Simple::Subclassing">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/Pod::Simple::Subclassing">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/Pod::Simple::Subclassing">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/Pod::Simple::Subclassing">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/Pod::Simple::Subclassing">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/Pod::Simple::Subclassing">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/Pod::Simple::Subclassing">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/Pod::Simple::Subclassing">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/Pod::Simple::Subclassing">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/Pod::Simple::Subclassing">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/Pod::Simple::Subclassing">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/Pod::Simple::Subclassing">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/Pod::Simple::Subclassing">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/Pod::Simple::Subclassing">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/Pod::Simple::Subclassing">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/Pod::Simple::Subclassing">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/Pod::Simple::Subclassing">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/Pod::Simple::Subclassing">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/Pod::Simple::Subclassing">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/Pod::Simple::Subclassing">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/Pod::Simple::Subclassing">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/Pod::Simple::Subclassing">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/Pod::Simple::Subclassing">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/Pod::Simple::Subclassing">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/Pod::Simple::Subclassing">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/Pod::Simple::Subclassing">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/Pod::Simple::Subclassing">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/Pod::Simple::Subclassing">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/Pod::Simple::Subclassing">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/Pod::Simple::Subclassing">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/Pod::Simple::Subclassing">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/Pod::Simple::Subclassing">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/Pod::Simple::Subclassing">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/Pod::Simple::Subclassing">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/Pod::Simple::Subclassing">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/Pod::Simple::Subclassing">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/Pod::Simple::Subclassing">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/Pod::Simple::Subclassing">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/Pod::Simple::Subclassing">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/Pod::Simple::Subclassing">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/Pod::Simple::Subclassing">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/Pod::Simple::Subclassing">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/Pod::Simple::Subclassing">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/Pod::Simple::Subclassing">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/Pod::Simple::Subclassing">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/Pod::Simple::Subclassing">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/Pod::Simple::Subclassing">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/Pod::Simple::Subclassing">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/Pod::Simple::Subclassing">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/Pod::Simple::Subclassing">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/Pod::Simple::Subclassing">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/Pod::Simple::Subclassing">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/Pod::Simple::Subclassing">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/Pod::Simple::Subclassing">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/Pod::Simple::Subclassing">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/Pod::Simple::Subclassing">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/Pod::Simple::Subclassing">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/Pod::Simple::Subclassing">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/Pod::Simple::Subclassing">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/Pod::Simple::Subclassing">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/Pod::Simple::Subclassing">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/Pod::Simple::Subclassing">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/Pod::Simple::Subclassing">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/Pod::Simple::Subclassing">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/Pod::Simple::Subclassing">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/Pod::Simple::Subclassing">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/Pod::Simple::Subclassing">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/Pod::Simple::Subclassing">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/Pod::Simple::Subclassing">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/Pod::Simple::Subclassing">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./Pod::Simple::Subclassing.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/Pod::Simple::Subclassing">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/Pod::Simple::Subclassing">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/Pod::Simple::Subclassing">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/Pod::Simple::Subclassing">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/Pod::Simple::Subclassing">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/Pod::Simple::Subclassing">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/Pod::Simple::Subclassing">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/Pod::Simple::Subclassing">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/Pod::Simple::Subclassing">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/Pod::Simple::Subclassing">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/Pod::Simple::Subclassing">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/Pod::Simple::Subclassing">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/Pod::Simple::Subclassing">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/Pod::Simple::Subclassing">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/Pod::Simple::Subclassing">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/Pod::Simple::Subclassing">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/Pod::Simple::Subclassing">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/Pod::Simple::Subclassing">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/Pod::Simple::Subclassing">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/Pod::Simple::Subclassing">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/Pod::Simple::Subclassing">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/Pod::Simple::Subclassing">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/Pod::Simple::Subclassing">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/Pod::Simple::Subclassing">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/Pod::Simple::Subclassing">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/Pod::Simple::Subclassing">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/Pod::Simple::Subclassing">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/Pod::Simple::Subclassing">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/Pod::Simple::Subclassing">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/Pod::Simple::Subclassing">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/Pod::Simple::Subclassing">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/Pod::Simple::Subclassing">5.35.1</a>
          <a class="dropdown-item active" href="./Pod::Simple::Subclassing.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./Pod::Simple::Subclassing.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="./Pod::Simple::Subclassing.html">Pod::Simple::Subclassing</a>
          <div id="more">
            (<a href="./Pod::Simple::Subclassing.txt">source</a>,
            <a href="https://metacpan.org/pod/Pod::Simple::Subclassing">CPAN</a>)
          </div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#SYNOPSIS">SYNOPSIS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#DESCRIPTION">DESCRIPTION</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#Events">Events</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#More-Pod::Simple-Methods">More Pod::Simple Methods</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#SEE-ALSO">SEE ALSO</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#SUPPORT">SUPPORT</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#COPYRIGHT-AND-DISCLAIMERS">COPYRIGHT AND DISCLAIMERS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Pod::Simple::Subclassing.html#AUTHOR">AUTHOR</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="./Pod::Simple::Subclassing.html#NAME">#</a>NAME</h1>

<p>Pod::Simple::Subclassing -- write a formatter as a Pod::Simple subclass</p>

<h1 id="SYNOPSIS"><a class="permalink" href="./Pod::Simple::Subclassing.html#SYNOPSIS">#</a>SYNOPSIS</h1>

<pre><code>  package Pod::SomeFormatter;
  use Pod::Simple;
  @ISA = qw(Pod::Simple);
  $VERSION = &#39;1.01&#39;;
  use strict;

  sub _handle_element_start {
	my($parser, $element_name, $attr_hash_r) = @_;
	...
  }

  sub _handle_element_end {
	my($parser, $element_name, $attr_hash_r) = @_;
	# NOTE: $attr_hash_r is only present when $element_name is &quot;over&quot; or &quot;begin&quot;
	# The remaining code excerpts will mostly ignore this $attr_hash_r, as it is
	# mostly useless. It is documented where &quot;over-*&quot; and &quot;begin&quot; events are
	# documented.
	...
  }

  sub _handle_text {
	my($parser, $text) = @_;
	...
  }
  1;</code></pre>

<h1 id="DESCRIPTION"><a class="permalink" href="./Pod::Simple::Subclassing.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>This document is about using Pod::Simple to write a Pod processor, generally a Pod formatter. If you just want to know about using an existing Pod formatter, instead see its documentation and see also the docs in <a href="./Pod::Simple.html">Pod::Simple</a>.</p>

<p><b>The zeroeth step</b> in writing a Pod formatter is to make sure that there isn&#39;t already a decent one in CPAN. See <a href="http://search.cpan.org/">http://search.cpan.org/</a>, and run a search on the name of the format you want to render to. Also consider joining the Pod People list <a href="http://lists.perl.org/showlist.cgi?name=pod-people">http://lists.perl.org/showlist.cgi?name=pod-people</a> and asking whether anyone has a formatter for that format -- maybe someone cobbled one together but just hasn&#39;t released it.</p>

<p><b>The first step</b> in writing a Pod processor is to read <a href="perlpodspec.html">perlpodspec</a>, which contains information on writing a Pod parser (which has been largely taken care of by Pod::Simple), but also a lot of requirements and recommendations for writing a formatter.</p>

<p><b>The second step</b> is to actually learn the format you&#39;re planning to format to -- or at least as much as you need to know to represent Pod, which probably isn&#39;t much.</p>

<p><b>The third step</b> is to pick which of Pod::Simple&#39;s interfaces you want to use:</p>

<dl>

<dt id="Pod::Simple"><a class="permalink" href="./Pod::Simple::Subclassing.html#Pod::Simple">#</a><a id="Pod"></a>Pod::Simple</dt>
<dd>

<p>The basic <a href="./Pod::Simple.html">Pod::Simple</a> interface that uses <code>_handle_element_start()</code>, <code>_handle_element_end()</code> and <code>_handle_text()</code>.</p>

</dd>
<dt id="Pod::Simple::Methody"><a class="permalink" href="./Pod::Simple::Subclassing.html#Pod::Simple::Methody">#</a><a id="Pod1"></a>Pod::Simple::Methody</dt>
<dd>

<p>The <a href="./Pod::Simple::Methody.html">Pod::Simple::Methody</a> interface is event-based, similar to that of <a href="./HTML::Parser.html">HTML::Parser</a> or <a href="./XML::Parser.html">XML::Parser</a>&#39;s &quot;Handlers&quot;.</p>

</dd>
<dt id="Pod::Simple::PullParser"><a class="permalink" href="./Pod::Simple::Subclassing.html#Pod::Simple::PullParser">#</a><a id="Pod2"></a>Pod::Simple::PullParser</dt>
<dd>

<p><a href="./Pod::Simple::PullParser.html">Pod::Simple::PullParser</a> provides a token-stream interface, sort of like <a href="./HTML::TokeParser.html">HTML::TokeParser</a>&#39;s interface.</p>

</dd>
<dt id="Pod::Simple::SimpleTree"><a class="permalink" href="./Pod::Simple::Subclassing.html#Pod::Simple::SimpleTree">#</a><a id="Pod3"></a>Pod::Simple::SimpleTree</dt>
<dd>

<p><a href="./Pod::Simple::SimpleTree.html">Pod::Simple::SimpleTree</a> provides a simple tree interface, rather like <a href="./XML::Parser.html">XML::Parser</a>&#39;s &quot;Tree&quot; interface. Users familiar with XML handling will be comfortable with this interface. Users interested in outputting XML, should look into the modules that produce an XML representation of the Pod stream, notably <a href="./Pod::Simple::XMLOutStream.html">Pod::Simple::XMLOutStream</a>; you can feed the output of such a class to whatever XML parsing system you are most at home with.</p>

</dd>
</dl>

<p><b>The last step</b> is to write your code based on how the events (or tokens, or tree-nodes, or the XML, or however you&#39;re parsing) will map to constructs in the output format. Also be sure to consider how to escape text nodes containing arbitrary text, and what to do with text nodes that represent preformatted text (from verbatim sections).</p>

<h1 id="Events"><a class="permalink" href="./Pod::Simple::Subclassing.html#Events">#</a>Events</h1>

<p>TODO intro... mention that events are supplied for implicits, like for missing &gt;&#39;s</p>

<p>In the following section, we use XML to represent the event structure associated with a particular construct. That is, an opening tag represents the element start, the attributes of that opening tag are the attributes given to the callback, and the closing tag represents the end element.</p>

<p>Three callback methods must be supplied by a class extending <a href="./Pod::Simple.html">Pod::Simple</a> to receive the corresponding event:</p>

<dl>

<dt id="$parser-&gt;_handle_element_start(-element_name,-attr_hashref-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3E_handle_element_start(-element_name,-attr_hashref-)">#</a><a id="_handle_element_start"></a><a id="parser-_handle_element_start-element_name-attr_hashref"></a><code>$parser-&gt;_handle_element_start( <i>element_name</i>, <i>attr_hashref</i> )</code></dt>
<dd>

</dd>
<dt id="$parser-&gt;_handle_element_end(-element_name-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3E_handle_element_end(-element_name-)">#</a><a id="_handle_element_end"></a><a id="parser-_handle_element_end-element_name"></a><code>$parser-&gt;_handle_element_end( <i>element_name</i> )</code></dt>
<dd>

</dd>
<dt id="$parser-&gt;_handle_text(-text_string-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3E_handle_text(-text_string-)">#</a><a id="_handle_text"></a><a id="parser-_handle_text-text_string"></a><code>$parser-&gt;_handle_text( <i>text_string</i> )</code></dt>
<dd>

</dd>
</dl>

<p>Here&#39;s the comprehensive list of values you can expect as <i>element_name</i> in your implementation of <code>_handle_element_start</code> and <code>_handle_element_end</code>::</p>

<dl>

<dt id="events-with-an-element_name-of-Document"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-Document">#</a><a id="events"></a>events with an element_name of Document</dt>
<dd>

<p>Parsing a document produces this event structure:</p>

<pre><code class="plaintext">  &lt;Document start_line=&quot;543&quot;&gt;
	...all events...
  &lt;/Document&gt;</code></pre>

<p>The value of the <i>start_line</i> attribute will be the line number of the first Pod directive in the document.</p>

<p>If there is no Pod in the given document, then the event structure will be this:</p>

<pre><code class="plaintext">&lt;Document contentless=&quot;1&quot; start_line=&quot;543&quot;&gt;
&lt;/Document&gt;</code></pre>

<p>In that case, the value of the <i>start_line</i> attribute will not be meaningful; under current implementations, it will probably be the line number of the last line in the file.</p>

</dd>
<dt id="events-with-an-element_name-of-Para"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-Para">#</a><a id="events1"></a>events with an element_name of Para</dt>
<dd>

<p>Parsing a plain (non-verbatim, non-directive, non-data) paragraph in a Pod document produces this event structure:</p>

<pre><code class="plaintext">&lt;Para start_line=&quot;543&quot;&gt;
  ...all events in this paragraph...
&lt;/Para&gt;</code></pre>

<p>The value of the <i>start_line</i> attribute will be the line number of the start of the paragraph.</p>

<p>For example, parsing this paragraph of Pod:</p>

<pre><code class="plaintext">The value of the I&lt;start_line&gt; attribute will be the
line number of the start of the paragraph.</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">&lt;Para start_line=&quot;129&quot;&gt;
  The value of the
  &lt;I&gt;
	start_line
  &lt;/I&gt;
   attribute will be the line number of the first Pod directive
  in the document.
&lt;/Para&gt;</code></pre>

</dd>
<dt id="events-with-an-element_name-of-B,-C,-F,-or-I."><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-B,-C,-F,-or-I.">#</a><a id="events2"></a><a id="events-with-an-element_name-of-B-C-F-or-I"></a>events with an element_name of B, C, F, or I.</dt>
<dd>

<p>Parsing a B&lt;...&gt; formatting code (or of course any of its semantically identical syntactic variants <span style="white-space: nowrap;">B&lt;&lt; ... &gt;&gt;</span>, or <span style="white-space: nowrap;">B&lt;&lt;&lt;&lt; ... &gt;&gt;&gt;&gt;</span>, etc.) produces this event structure:</p>

<pre><code class="plaintext">  &lt;B&gt;
	...stuff...
  &lt;/B&gt;</code></pre>

<p>Currently, there are no attributes conveyed.</p>

<p>Parsing C, F, or I codes produce the same structure, with only a different element name.</p>

<p>If your parser object has been set to accept other formatting codes, then they will be presented like these B/C/F/I codes -- i.e., without any attributes.</p>

</dd>
<dt id="events-with-an-element_name-of-S"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-S">#</a><a id="events3"></a>events with an element_name of S</dt>
<dd>

<p>Normally, parsing an S&lt;...&gt; sequence produces this event structure, just as if it were a B/C/F/I code:</p>

<pre><code class="plaintext">  &lt;S&gt;
	...stuff...
  &lt;/S&gt;</code></pre>

<p>However, Pod::Simple (and presumably all derived parsers) offers the <code>nbsp_for_S</code> option which, if enabled, will suppress all S events, and instead change all spaces in the content to non-breaking spaces. This is intended for formatters that output to a format that has no code that means the same as S&lt;...&gt;, but which has a code/character that means non-breaking space.</p>

</dd>
<dt id="events-with-an-element_name-of-X"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-X">#</a><a id="events4"></a>events with an element_name of X</dt>
<dd>

<p>Normally, parsing an X&lt;...&gt; sequence produces this event structure, just as if it were a B/C/F/I code:</p>

<pre><code class="plaintext">  &lt;X&gt;
	...stuff...
  &lt;/X&gt;</code></pre>

<p>However, Pod::Simple (and presumably all derived parsers) offers the <code>nix_X_codes</code> option which, if enabled, will suppress all X events and ignore their content. For formatters/processors that don&#39;t use X events, this is presumably quite useful.</p>

</dd>
<dt id="events-with-an-element_name-of-L"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-L">#</a><a id="events5"></a>events with an element_name of L</dt>
<dd>

<p>Because the L&lt;...&gt; is the most complex construct in the language, it should not surprise you that the events it generates are the most complex in the language. Most of complexity is hidden away in the attribute values, so for those of you writing a Pod formatter that produces a non-hypertextual format, you can just ignore the attributes and treat an L event structure like a formatting element that (presumably) doesn&#39;t actually produce a change in formatting. That is, the content of the L event structure (as opposed to its attributes) is always what text should be displayed.</p>

<p>There are, at first glance, three kinds of L links: URL, man, and pod.</p>

<p>When a L&lt;<i>some_url</i>&gt; code is parsed, it produces this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;that_url&quot; to=&quot;that_url&quot; type=&quot;url&quot;&gt;
	that_url
  &lt;/L&gt;</code></pre>

<p>The <code>type=&quot;url&quot;</code> attribute is always specified for this type of L code.</p>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">L&lt;http://www.perl.com/CPAN/authors/&gt;</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;http://www.perl.com/CPAN/authors/&quot; to=&quot;http://www.perl.com/CPAN/authors/&quot; type=&quot;url&quot;&gt;
	http://www.perl.com/CPAN/authors/
  &lt;/L&gt;</code></pre>

<p>When a L&lt;<i>manpage(section)</i>&gt; code is parsed (and these are fairly rare and not terribly useful), it produces this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;manpage(section)&quot; to=&quot;manpage(section)&quot; type=&quot;man&quot;&gt;
	manpage(section)
  &lt;/L&gt;</code></pre>

<p>The <code>type=&quot;man&quot;</code> attribute is always specified for this type of L code.</p>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">L&lt;crontab(5)&gt;</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;crontab(5)&quot; to=&quot;crontab(5)&quot; type=&quot;man&quot;&gt;
	crontab(5)
  &lt;/L&gt;</code></pre>

<p>In the rare cases where a man page link has a section specified, that text appears in a <i>section</i> attribute. For example, this Pod source:</p>

<pre><code class="plaintext">L&lt;crontab(5)/&quot;ENVIRONMENT&quot;&gt;</code></pre>

<p>will produce this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;crontab(5)/&amp;quot;ENVIRONMENT&amp;quot;&quot; section=&quot;ENVIRONMENT&quot; to=&quot;crontab(5)&quot; type=&quot;man&quot;&gt;
	&quot;ENVIRONMENT&quot; in crontab(5)
  &lt;/L&gt;</code></pre>

<p>In the rare case where the Pod document has code like L&lt;<i>sometext</i>|<i>manpage(section)</i>&gt;, then the <i>sometext</i> will appear as the content of the element, the <i>manpage(section)</i> text will appear only as the value of the <i>to</i> attribute, and there will be no <code>content-implicit=&quot;yes&quot;</code> attribute (whose presence means that the Pod parser had to infer what text should appear as the link text -- as opposed to cases where that attribute is absent, which means that the Pod parser did <i>not</i> have to infer the link text, because that L code explicitly specified some link text.)</p>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">L&lt;hell itself!|crontab(5)&gt;</code></pre>

<p>will produce this event structure:</p>

<pre><code class="plaintext">  &lt;L raw=&quot;hell itself!|crontab(5)&quot; to=&quot;crontab(5)&quot; type=&quot;man&quot;&gt;
	hell itself!
  &lt;/L&gt;</code></pre>

<p>The last type of L structure is for links to/within Pod documents. It is the most complex because it can have a <i>to</i> attribute, <i>or</i> a <i>section</i> attribute, or both. The <code>type=&quot;pod&quot;</code> attribute is always specified for this type of L code.</p>

<p>In the most common case, the simple case of a L&lt;podpage&gt; code produces this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;podpage&quot; to=&quot;podpage&quot; type=&quot;pod&quot;&gt;
	podpage
  &lt;/L&gt;</code></pre>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">L&lt;Net::Ping&gt;</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;Net::Ping&quot; to=&quot;Net::Ping&quot; type=&quot;pod&quot;&gt;
	Net::Ping
  &lt;/L&gt;</code></pre>

<p>In cases where there is link-text explicitly specified, it is to be found in the content of the element (and not the attributes), just as with the L&lt;<i>sometext</i>|<i>manpage(section)</i>&gt; case discussed above. For example, this Pod source:</p>

<pre><code class="plaintext">L&lt;Perl Error Messages|perldiag&gt;</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;L raw=&quot;Perl Error Messages|perldiag&quot; to=&quot;perldiag&quot; type=&quot;pod&quot;&gt;
	Perl Error Messages
  &lt;/L&gt;</code></pre>

<p>In cases of links to a section in the current Pod document, there is a <i>section</i> attribute instead of a <i>to</i> attribute. For example, this Pod source:</p>

<pre><code class="plaintext">L&lt;/&quot;Member Data&quot;&gt;</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;/&amp;quot;Member Data&amp;quot;&quot; section=&quot;Member Data&quot; type=&quot;pod&quot;&gt;
	&quot;Member Data&quot;
  &lt;/L&gt;</code></pre>

<p>As another example, this Pod source:</p>

<pre><code class="plaintext">L&lt;the various attributes|/&quot;Member Data&quot;&gt;</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;L raw=&quot;the various attributes|/&amp;quot;Member Data&amp;quot;&quot; section=&quot;Member Data&quot; type=&quot;pod&quot;&gt;
	the various attributes
  &lt;/L&gt;</code></pre>

<p>In cases of links to a section in a different Pod document, there are both a <i>section</i> attribute and a <a href="to.html">to</a> attribute. For example, this Pod source:</p>

<pre><code class="plaintext">L&lt;perlsyn/&quot;Basic BLOCKs and Switch Statements&quot;&gt;</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;L content-implicit=&quot;yes&quot; raw=&quot;perlsyn/&amp;quot;Basic BLOCKs and Switch Statements&amp;quot;&quot; section=&quot;Basic BLOCKs and Switch Statements&quot; to=&quot;perlsyn&quot; type=&quot;pod&quot;&gt;
	&quot;Basic BLOCKs and Switch Statements&quot; in perlsyn
  &lt;/L&gt;</code></pre>

<p>As another example, this Pod source:</p>

<pre><code class="plaintext">L&lt;SWITCH statements|perlsyn/&quot;Basic BLOCKs and Switch Statements&quot;&gt;</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;L raw=&quot;SWITCH statements|perlsyn/&amp;quot;Basic BLOCKs and Switch Statements&amp;quot;&quot; section=&quot;Basic BLOCKs and Switch Statements&quot; to=&quot;perlsyn&quot; type=&quot;pod&quot;&gt;
	SWITCH statements
  &lt;/L&gt;</code></pre>

<p>Incidentally, note that we do not distinguish between these syntaxes:</p>

<pre><code class="plaintext">L&lt;/&quot;Member Data&quot;&gt;
L&lt;&quot;Member Data&quot;&gt;
L&lt;/Member Data&gt;
L&lt;Member Data&gt;    [deprecated syntax]</code></pre>

<p>That is, they all produce the same event structure (for the most part), namely:</p>

<pre><code>  &lt;L content-implicit=&quot;yes&quot; raw=&quot;$depends_on_syntax&quot; section=&quot;Member Data&quot; type=&quot;pod&quot;&gt;
	&amp;#34;Member Data&amp;#34;
  &lt;/L&gt;</code></pre>

<p>The <i>raw</i> attribute depends on what the raw content of the <code>L&lt;&gt;</code> is, so that is why the event structure is the same &quot;for the most part&quot;.</p>

<p>If you have not guessed it yet, the <i>raw</i> attribute contains the raw, original, unescaped content of the <code>L&lt;&gt;</code> formatting code. In addition to the examples above, take notice of the following event structure produced by the following <code>L&lt;&gt;</code> formatting code.</p>

<pre><code class="plaintext">  L&lt;click B&lt;here&gt;|page/About the C&lt;-M&gt; switch&gt;

  &lt;L raw=&quot;click B&lt;here&gt;|page/About the C&lt;-M&gt; switch&quot; section=&quot;About the -M switch&quot; to=&quot;page&quot; type=&quot;pod&quot;&gt;
	click B&lt;here&gt;
  &lt;/L&gt;</code></pre>

<p>Specifically, notice that the formatting codes are present and unescaped in <i>raw</i>.</p>

<p>There is a known bug in the <i>raw</i> attribute where any surrounding whitespace is condensed into a single &#39; &#39;. For example, given L&lt; link&gt;, <i>raw</i> will be &quot; link&quot;.</p>

</dd>
<dt id="events-with-an-element_name-of-E-or-Z"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-E-or-Z">#</a><a id="events6"></a>events with an element_name of E or Z</dt>
<dd>

<p>While there are Pod codes E&lt;...&gt; and Z&lt;&gt;, these <i>do not</i> produce any E or Z events -- that is, there are no such events as E or Z.</p>

</dd>
<dt id="events-with-an-element_name-of-Verbatim"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-Verbatim">#</a><a id="events7"></a>events with an element_name of Verbatim</dt>
<dd>

<p>When a Pod verbatim paragraph (AKA &quot;codeblock&quot;) is parsed, it produces this event structure:</p>

<pre><code class="plaintext">  &lt;Verbatim start_line=&quot;543&quot; xml:space=&quot;preserve&quot;&gt;
	...text...
  &lt;/Verbatim&gt;</code></pre>

<p>The value of the <i>start_line</i> attribute will be the line number of the first line of this verbatim block. The <i>xml:space</i> attribute is always present, and always has the value &quot;preserve&quot;.</p>

<p>The text content will have tabs already expanded.</p>

</dd>
<dt id="events-with-an-element_name-of-head1-..-head4"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-head1-..-head4">#</a><a id="events8"></a>events with an element_name of head1 .. head4</dt>
<dd>

<p>When a &quot;=head1 ...&quot; directive is parsed, it produces this event structure:</p>

<pre><code class="plaintext">  &lt;head1&gt;
	...stuff...
  &lt;/head1&gt;</code></pre>

<p>For example, a directive consisting of this:</p>

<pre><code class="plaintext">=head1 Options to C&lt;new&gt; et al.</code></pre>

<p>will produce this event structure:</p>

<pre><code class="plaintext">  &lt;head1 start_line=&quot;543&quot;&gt;
	Options to
	&lt;C&gt;
	  new
	&lt;/C&gt;
	 et al.
  &lt;/head1&gt;</code></pre>

<p>&quot;=head2&quot; through &quot;=head4&quot; directives are the same, except for the element names in the event structure.</p>

</dd>
<dt id="events-with-an-element_name-of-encoding"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-encoding">#</a><a id="events9"></a>events with an element_name of encoding</dt>
<dd>

<p>In the default case, the events corresponding to <code>=encoding</code> directives are not emitted. They are emitted if <code>keep_encoding_directive</code> is true. In that case they produce event structures like <a href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-head1-..-head4">&quot;events with an element_name of head1 .. head4&quot;</a> above.</p>

</dd>
<dt id="events-with-an-element_name-of-over-bullet"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-bullet">#</a><a id="events10"></a>events with an element_name of over-bullet</dt>
<dd>

<p>When an &quot;=over ... =back&quot; block is parsed where the items are a bulleted list, it will produce this event structure:</p>

<pre><code class="plaintext">  &lt;over-bullet indent=&quot;4&quot; start_line=&quot;543&quot;&gt;
	&lt;item-bullet start_line=&quot;545&quot;&gt;
	  ...Stuff...
	&lt;/item-bullet&gt;
	...more item-bullets...
  &lt;/over-bullet fake-closer=&quot;1&quot;&gt;</code></pre>

<p>The attribute <i>fake-closer</i> is only present if it is a true value; it is not present if it is a false value. It is shown in the above example to illustrate where the attribute is (in the <b>closing</b> tag). It signifies that the <code>=over</code> did not have a matching <code>=back</code>, and thus Pod::Simple had to create a fake closer.</p>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">=over

=item *

Something

=back</code></pre>

<p>Would produce an event structure that does <b>not</b> have the <i>fake-closer</i> attribute, whereas this Pod source:</p>

<pre><code class="plaintext">=over

=item *

Gasp! An unclosed =over block!</code></pre>

<p>would. The rest of the over-* examples will not demonstrate this attribute, but they all can have it. See <a href="./Pod::Checker.html">Pod::Checker</a>&#39;s source for an example of this attribute being used.</p>

<p>The value of the <i>indent</i> attribute is whatever value is after the &quot;=over&quot; directive, as in &quot;=over 8&quot;. If no such value is specified in the directive, then the <i>indent</i> attribute has the value &quot;4&quot;.</p>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">=over

=item *

Stuff

=item *

Bar I&lt;baz&gt;!

=back</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;over-bullet indent=&quot;4&quot; start_line=&quot;10&quot;&gt;
	&lt;item-bullet start_line=&quot;12&quot;&gt;
	  Stuff
	&lt;/item-bullet&gt;
	&lt;item-bullet start_line=&quot;14&quot;&gt;
	  Bar &lt;I&gt;baz&lt;/I&gt;!
	&lt;/item-bullet&gt;
  &lt;/over-bullet&gt;</code></pre>

</dd>
<dt id="events-with-an-element_name-of-over-number"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-number">#</a><a id="events11"></a>events with an element_name of over-number</dt>
<dd>

<p>When an &quot;=over ... =back&quot; block is parsed where the items are a numbered list, it will produce this event structure:</p>

<pre><code class="plaintext">  &lt;over-number indent=&quot;4&quot; start_line=&quot;543&quot;&gt;
	&lt;item-number number=&quot;1&quot; start_line=&quot;545&quot;&gt;
	  ...Stuff...
	&lt;/item-number&gt;
	...more item-number...
  &lt;/over-bullet&gt;</code></pre>

<p>This is like the &quot;over-bullet&quot; event structure; but note that the contents are &quot;item-number&quot; instead of &quot;item-bullet&quot;, and note that they will have a &quot;number&quot; attribute, which some formatters/processors may ignore (since, for example, there&#39;s no need for it in HTML when producing an &quot;&lt;UL&gt;&lt;LI&gt;...&lt;/LI&gt;...&lt;/UL&gt;&quot; structure), but which any processor may use.</p>

<p>Note that the values for the <i>number</i> attributes of &quot;item-number&quot; elements in a given &quot;over-number&quot; area <i>will</i> start at 1 and go up by one each time. If the Pod source doesn&#39;t follow that order (even though it really should!), whatever numbers it has will be ignored (with the correct values being put in the <i>number</i> attributes), and an error message might be issued to the user.</p>

</dd>
<dt id="events-with-an-element_name-of-over-text"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-text">#</a><a id="events12"></a>events with an element_name of over-text</dt>
<dd>

<p>These events are somewhat unlike the other over-* structures, as far as what their contents are. When an &quot;=over ... =back&quot; block is parsed where the items are a list of text &quot;subheadings&quot;, it will produce this event structure:</p>

<pre><code class="plaintext">  &lt;over-text indent=&quot;4&quot; start_line=&quot;543&quot;&gt;
	&lt;item-text&gt;
	  ...stuff...
	&lt;/item-text&gt;
	...stuff (generally Para or Verbatim elements)...
	&lt;item-text&gt;
	...more item-text and/or stuff...
  &lt;/over-text&gt;</code></pre>

<p>The <i>indent</i> and <i>fake-closer</i> attributes are as with the other over-* events.</p>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">=over

=item Foo

Stuff

=item Bar I&lt;baz&gt;!

Quux

=back</code></pre>

<p>produces this event structure:</p>

<pre><code class="plaintext">  &lt;over-text indent=&quot;4&quot; start_line=&quot;20&quot;&gt;
	&lt;item-text start_line=&quot;22&quot;&gt;
	  Foo
	&lt;/item-text&gt;
	&lt;Para start_line=&quot;24&quot;&gt;
	  Stuff
	&lt;/Para&gt;
	&lt;item-text start_line=&quot;26&quot;&gt;
	  Bar
		&lt;I&gt;
		  baz
		&lt;/I&gt;
	  !
	&lt;/item-text&gt;
	&lt;Para start_line=&quot;28&quot;&gt;
	  Quux
	&lt;/Para&gt;
  &lt;/over-text&gt;</code></pre>

</dd>
<dt id="events-with-an-element_name-of-over-block"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-block">#</a><a id="events13"></a>events with an element_name of over-block</dt>
<dd>

<p>These events are somewhat unlike the other over-* structures, as far as what their contents are. When an &quot;=over ... =back&quot; block is parsed where there are no items, it will produce this event structure:</p>

<pre><code class="plaintext">  &lt;over-block indent=&quot;4&quot; start_line=&quot;543&quot;&gt;
	...stuff (generally Para or Verbatim elements)...
  &lt;/over-block&gt;</code></pre>

<p>The <i>indent</i> and <i>fake-closer</i> attributes are as with the other over-* events.</p>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">=over

For cutting off our trade with all parts of the world

For transporting us beyond seas to be tried for pretended offenses

He is at this time transporting large armies of foreign mercenaries to
complete the works of death, desolation and tyranny, already begun with
circumstances of cruelty and perfidy scarcely paralleled in the most
barbarous ages, and totally unworthy the head of a civilized nation.

=back</code></pre>

<p>will produce this event structure:</p>

<pre><code class="plaintext">  &lt;over-block indent=&quot;4&quot; start_line=&quot;2&quot;&gt;
	&lt;Para start_line=&quot;4&quot;&gt;
	  For cutting off our trade with all parts of the world
	&lt;/Para&gt;
	&lt;Para start_line=&quot;6&quot;&gt;
	  For transporting us beyond seas to be tried for pretended offenses
	&lt;/Para&gt;
	&lt;Para start_line=&quot;8&quot;&gt;
	  He is at this time transporting large armies of [...more text...]
	&lt;/Para&gt;
  &lt;/over-block&gt;</code></pre>

</dd>
<dt id="events-with-an-element_name-of-over-empty"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-empty">#</a><a id="events14"></a>events with an element_name of over-empty</dt>
<dd>

<p><b>Note: These events are only triggered if <code>parse_empty_lists()</code> is set to a true value.</b></p>

<p>These events are somewhat unlike the other over-* structures, as far as what their contents are. When an &quot;=over ... =back&quot; block is parsed where there is no content, it will produce this event structure:</p>

<pre><code class="plaintext">&lt;over-empty indent=&quot;4&quot; start_line=&quot;543&quot;&gt;
&lt;/over-empty&gt;</code></pre>

<p>The <i>indent</i> and <i>fake-closer</i> attributes are as with the other over-* events.</p>

<p>For example, this Pod source:</p>

<pre><code class="plaintext">=over

=over

=back

=back</code></pre>

<p>will produce this event structure:</p>

<pre><code class="plaintext">  &lt;over-block indent=&quot;4&quot; start_line=&quot;1&quot;&gt;
	&lt;over-empty indent=&quot;4&quot; start_line=&quot;3&quot;&gt;
	&lt;/over-empty&gt;
  &lt;/over-block&gt;</code></pre>

<p>Note that the outer <code>=over</code> is a block because it has no <code>=item</code>s but still has content: the inner <code>=over</code>. The inner <code>=over</code>, in turn, is completely empty, and is treated as such.</p>

</dd>
<dt id="events-with-an-element_name-of-item-bullet"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-item-bullet">#</a><a id="events15"></a>events with an element_name of item-bullet</dt>
<dd>

<p>See <a href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-bullet">&quot;events with an element_name of over-bullet&quot;</a>, above.</p>

</dd>
<dt id="events-with-an-element_name-of-item-number"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-item-number">#</a><a id="events16"></a>events with an element_name of item-number</dt>
<dd>

<p>See <a href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-number">&quot;events with an element_name of over-number&quot;</a>, above.</p>

</dd>
<dt id="events-with-an-element_name-of-item-text"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-item-text">#</a><a id="events17"></a>events with an element_name of item-text</dt>
<dd>

<p>See <a href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-text">&quot;events with an element_name of over-text&quot;</a>, above.</p>

</dd>
<dt id="events-with-an-element_name-of-for"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-for">#</a><a id="events18"></a>events with an element_name of for</dt>
<dd>

<p>TODO...</p>

</dd>
<dt id="events-with-an-element_name-of-Data"><a class="permalink" href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-Data">#</a><a id="events19"></a>events with an element_name of Data</dt>
<dd>

<p>TODO...</p>

</dd>
</dl>

<h1 id="More-Pod::Simple-Methods"><a class="permalink" href="./Pod::Simple::Subclassing.html#More-Pod::Simple-Methods">#</a><a id="More"></a>More Pod::Simple Methods</h1>

<p>Pod::Simple provides a lot of methods that aren&#39;t generally interesting to the end user of an existing Pod formatter, but some of which you might find useful in writing a Pod formatter. They are listed below. The first several methods (the accept_* methods) are for declaring the capabilities of your parser, notably what <code>=for <i>targetname</i></code> sections it&#39;s interested in, what extra N&lt;...&gt; codes it accepts beyond the ones described in the <i>perlpod</i>.</p>

<dl>

<dt id="$parser-&gt;accept_targets(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eaccept_targets(-SOMEVALUE-)">#</a><a id="accept_targets"></a><a id="parser-accept_targets-SOMEVALUE"></a><code>$parser-&gt;accept_targets( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>As the parser sees sections like:</p>

<pre><code class="plaintext">=for html  &lt;img src=&quot;fig1.jpg&quot;&gt;</code></pre>

<p>or</p>

<pre><code class="plaintext">=begin html

  &lt;img src=&quot;fig1.jpg&quot;&gt;

=end html</code></pre>

<p>...the parser will ignore these sections unless your subclass has specified that it wants to see sections targeted to &quot;html&quot; (or whatever the formatter name is).</p>

<p>If you want to process all sections, even if they&#39;re not targeted for you, call this before you start parsing:</p>

<pre><code>$parser-&gt;accept_targets(&#39;*&#39;);</code></pre>

</dd>
<dt id="$parser-&gt;accept_targets_as_text(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eaccept_targets_as_text(-SOMEVALUE-)">#</a><a id="accept_targets_as_text"></a><a id="parser-accept_targets_as_text-SOMEVALUE"></a><code>$parser-&gt;accept_targets_as_text( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>This is like accept_targets, except that it specifies also that the content of sections for this target should be treated as Pod text even if the target name in &quot;=for <i>targetname</i>&quot; doesn&#39;t start with a &quot;:&quot;.</p>

<p>At time of writing, I don&#39;t think you&#39;ll need to use this.</p>

</dd>
<dt id="$parser-&gt;accept_codes(-Codename,-Codename...-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eaccept_codes(-Codename,-Codename...-)">#</a><a id="accept_codes"></a><a id="parser-accept_codes-Codename-Codename"></a><code>$parser-&gt;accept_codes( <i>Codename</i>, <i>Codename</i>... )</code></dt>
<dd>

<p>This tells the parser that you accept additional formatting codes, beyond just the standard ones (I B C L F S X, plus the two weird ones you don&#39;t actually see in the parse tree, Z and E). For example, to also accept codes &quot;N&quot;, &quot;R&quot;, and &quot;W&quot;:</p>

<pre><code>$parser-&gt;accept_codes( qw( N R W ) );</code></pre>

<p><b>TODO: document how this interacts with =extend, and long element names</b></p>

</dd>
<dt id="$parser-&gt;accept_directive_as_data(-directive_name-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eaccept_directive_as_data(-directive_name-)">#</a><a id="accept_directive_as_data"></a><a id="parser-accept_directive_as_data-directive_name"></a><code>$parser-&gt;accept_directive_as_data( <i>directive_name</i> )</code></dt>
<dd>

</dd>
<dt id="$parser-&gt;accept_directive_as_verbatim(-directive_name-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eaccept_directive_as_verbatim(-directive_name-)">#</a><a id="accept_directive_as_verbatim"></a><a id="parser-accept_directive_as_verbatim-directive_name"></a><code>$parser-&gt;accept_directive_as_verbatim( <i>directive_name</i> )</code></dt>
<dd>

</dd>
<dt id="$parser-&gt;accept_directive_as_processed(-directive_name-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eaccept_directive_as_processed(-directive_name-)">#</a><a id="accept_directive_as_processed"></a><a id="parser-accept_directive_as_processed-directive_name"></a><code>$parser-&gt;accept_directive_as_processed( <i>directive_name</i> )</code></dt>
<dd>

<p>In the unlikely situation that you need to tell the parser that you will accept additional directives (&quot;=foo&quot; things), you need to first set the parser to treat its content as data (i.e., not really processed at all), or as verbatim (mostly just expanding tabs), or as processed text (parsing formatting codes like B&lt;...&gt;).</p>

<p>For example, to accept a new directive &quot;=method&quot;, you&#39;d presumably use:</p>

<pre><code>$parser-&gt;accept_directive_as_processed(&quot;method&quot;);</code></pre>

<p>so that you could have Pod lines like:</p>

<pre><code>=method I&lt;$whatever&gt; thing B&lt;um&gt;</code></pre>

<p>Making up your own directives breaks compatibility with other Pod formatters, in a way that using &quot;=for <i>target</i> ...&quot; lines doesn&#39;t; however, you may find this useful if you&#39;re making a Pod superset format where you don&#39;t need to worry about compatibility.</p>

</dd>
<dt id="$parser-&gt;nbsp_for_S(-BOOLEAN-);"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Enbsp_for_S(-BOOLEAN-);">#</a><a id="nbsp_for_S"></a><a id="parser-nbsp_for_S-BOOLEAN"></a><code>$parser-&gt;nbsp_for_S( <i>BOOLEAN</i> );</code></dt>
<dd>

<p>Setting this attribute to a true value (and by default it is false) will turn &quot;S&lt;...&gt;&quot; sequences into sequences of words separated by <code>\xA0</code> (non-breaking space) characters. For example, it will take this:</p>

<pre><code class="plaintext">I like S&lt;Dutch apple pie&gt;, don&#39;t you?</code></pre>

<p>and treat it as if it were:</p>

<pre><code class="plaintext">I like DutchE&lt;nbsp&gt;appleE&lt;nbsp&gt;pie, don&#39;t you?</code></pre>

<p>This is handy for output formats that don&#39;t have anything quite like an &quot;S&lt;...&gt;&quot; code, but which do have a code for non-breaking space.</p>

<p>There is currently no method for going the other way; but I can probably provide one upon request.</p>

</dd>
<dt id="$parser-&gt;version_report()"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eversion_report()">#</a><a id="version_report"></a><a id="parser-version_report"></a><code>$parser-&gt;version_report()</code></dt>
<dd>

<p>This returns a string reporting the $VERSION value from your module (and its classname) as well as the $VERSION value of Pod::Simple. Note that <a href="perlpodspec.html">perlpodspec</a> requires output formats (wherever possible) to note this detail in a comment in the output format. For example, for some kind of SGML output format:</p>

<pre><code>print OUT &quot;&lt;!-- \n&quot;, $parser-&gt;version_report, &quot;\n --&gt;&quot;;</code></pre>

</dd>
<dt id="$parser-&gt;pod_para_count()"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Epod_para_count()">#</a><a id="pod_para_count"></a><a id="parser-pod_para_count"></a><code>$parser-&gt;pod_para_count()</code></dt>
<dd>

<p>This returns the count of Pod paragraphs seen so far.</p>

</dd>
<dt id="$parser-&gt;line_count()"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eline_count()">#</a><a id="line_count"></a><a id="parser-line_count"></a><code>$parser-&gt;line_count()</code></dt>
<dd>

<p>This is the current line number being parsed. But you might find the &quot;line_number&quot; event attribute more accurate, when it is present.</p>

</dd>
<dt id="$parser-&gt;nix_X_codes(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Enix_X_codes(-SOMEVALUE-)">#</a><a id="nix_X_codes"></a><a id="parser-nix_X_codes-SOMEVALUE"></a><code>$parser-&gt;nix_X_codes( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>This attribute, when set to a true value (and it is false by default) ignores any &quot;X&lt;...&gt;&quot; sequences in the document being parsed. Many formats don&#39;t actually use the content of these codes, so have no reason to process them.</p>

</dd>
<dt id="$parser-&gt;keep_encoding_directive(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Ekeep_encoding_directive(-SOMEVALUE-)">#</a><a id="keep_encoding_directive"></a><a id="parser-keep_encoding_directive-SOMEVALUE"></a><code>$parser-&gt;keep_encoding_directive( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>This attribute, when set to a true value (it is false by default) will keep <code>=encoding</code> and its content in the event structure. Most formats don&#39;t actually need to process the content of an <code>=encoding</code> directive, even when this directive sets the encoding and the processor makes use of the encoding information. Indeed, it is possible to know the encoding without processing the directive content.</p>

</dd>
<dt id="$parser-&gt;merge_text(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Emerge_text(-SOMEVALUE-)">#</a><a id="merge_text"></a><a id="parser-merge_text-SOMEVALUE"></a><code>$parser-&gt;merge_text( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>This attribute, when set to a true value (and it is false by default) makes sure that only one event (or token, or node) will be created for any single contiguous sequence of text. For example, consider this somewhat contrived example:</p>

<pre><code class="plaintext">I just LOVE Z&lt;&gt;hotE&lt;32&gt;apple pie!</code></pre>

<p>When that is parsed and events are about to be called on it, it may actually seem to be four different text events, one right after another: one event for &quot;I just LOVE &quot;, one for &quot;hot&quot;, one for &quot; &quot;, and one for &quot;apple pie!&quot;. But if you have merge_text on, then you&#39;re guaranteed that it will be fired as one text event: &quot;I just LOVE hot apple pie!&quot;.</p>

</dd>
<dt id="$parser-&gt;code_handler(-CODE_REF-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Ecode_handler(-CODE_REF-)">#</a><a id="code_handler"></a><a id="parser-code_handler-CODE_REF"></a><code>$parser-&gt;code_handler( <i>CODE_REF</i> )</code></dt>
<dd>

<p>This specifies code that should be called when a code line is seen (i.e., a line outside of the Pod). Normally this is undef, meaning that no code should be called. If you provide a routine, it should start out like this:</p>

<pre><code>sub get_code_line {  # or whatever you&#39;ll call it
  my($line, $line_number, $parser) = @_;
  ...
}</code></pre>

<p>Note, however, that sometimes the Pod events aren&#39;t processed in exactly the same order as the code lines are -- i.e., if you have a file with Pod, then code, then more Pod, sometimes the code will be processed (via whatever you have code_handler call) before the all of the preceding Pod has been processed.</p>

</dd>
<dt id="$parser-&gt;cut_handler(-CODE_REF-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Ecut_handler(-CODE_REF-)">#</a><a id="cut_handler"></a><a id="parser-cut_handler-CODE_REF"></a><code>$parser-&gt;cut_handler( <i>CODE_REF</i> )</code></dt>
<dd>

<p>This is just like the code_handler attribute, except that it&#39;s for &quot;=cut&quot; lines, not code lines. The same caveats apply. &quot;=cut&quot; lines are unlikely to be interesting, but this is included for completeness.</p>

</dd>
<dt id="$parser-&gt;pod_handler(-CODE_REF-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Epod_handler(-CODE_REF-)">#</a><a id="pod_handler"></a><a id="parser-pod_handler-CODE_REF"></a><code>$parser-&gt;pod_handler( <i>CODE_REF</i> )</code></dt>
<dd>

<p>This is just like the code_handler attribute, except that it&#39;s for &quot;=pod&quot; lines, not code lines. The same caveats apply. &quot;=pod&quot; lines are unlikely to be interesting, but this is included for completeness.</p>

</dd>
<dt id="$parser-&gt;whiteline_handler(-CODE_REF-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Ewhiteline_handler(-CODE_REF-)">#</a><a id="whiteline_handler"></a><a id="parser-whiteline_handler-CODE_REF"></a><code>$parser-&gt;whiteline_handler( <i>CODE_REF</i> )</code></dt>
<dd>

<p>This is just like the code_handler attribute, except that it&#39;s for lines that are seemingly blank but have whitespace (&quot; &quot; and/or &quot;\t&quot;) on them, not code lines. The same caveats apply. These lines are unlikely to be interesting, but this is included for completeness.</p>

</dd>
<dt id="$parser-&gt;whine(-linenumber,-complaint-string-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Ewhine(-linenumber,-complaint-string-)">#</a><a id="whine"></a><a id="parser-whine-linenumber-complaint-string"></a><code>$parser-&gt;whine( <i>linenumber</i>, <i>complaint string</i> )</code></dt>
<dd>

<p>This notes a problem in the Pod, which will be reported in the &quot;Pod Errors&quot; section of the document and/or sent to STDERR, depending on the values of the attributes <code>no_whining</code>, <code>no_errata_section</code>, and <code>complain_stderr</code>.</p>

</dd>
<dt id="$parser-&gt;scream(-linenumber,-complaint-string-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Escream(-linenumber,-complaint-string-)">#</a><a id="scream"></a><a id="parser-scream-linenumber-complaint-string"></a><code>$parser-&gt;scream( <i>linenumber</i>, <i>complaint string</i> )</code></dt>
<dd>

<p>This notes an error like <code>whine</code> does, except that it is not suppressible with <code>no_whining</code>. This should be used only for very serious errors.</p>

</dd>
<dt id="$parser-&gt;source_dead(1)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Esource_dead(1)">#</a><a id="source_dead"></a><a id="parser-source_dead-1"></a><code>$parser-&gt;source_dead(1)</code></dt>
<dd>

<p>This aborts parsing of the current document, by switching on the flag that indicates that EOF has been seen. In particularly drastic cases, you might want to do this. It&#39;s rather nicer than just calling <code>die</code>!</p>

</dd>
<dt id="$parser-&gt;hide_line_numbers(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Ehide_line_numbers(-SOMEVALUE-)">#</a><a id="hide_line_numbers"></a><a id="parser-hide_line_numbers-SOMEVALUE"></a><code>$parser-&gt;hide_line_numbers( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>Some subclasses that indiscriminately dump event attributes (well, except for ones beginning with &quot;~&quot;) can use this object attribute for refraining to dump the &quot;start_line&quot; attribute.</p>

</dd>
<dt id="$parser-&gt;no_whining(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eno_whining(-SOMEVALUE-)">#</a><a id="no_whining"></a><a id="parser-no_whining-SOMEVALUE"></a><code>$parser-&gt;no_whining( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>This attribute, if set to true, will suppress reports of non-fatal error messages. The default value is false, meaning that complaints <i>are</i> reported. How they get reported depends on the values of the attributes <code>no_errata_section</code> and <code>complain_stderr</code>.</p>

</dd>
<dt id="$parser-&gt;no_errata_section(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eno_errata_section(-SOMEVALUE-)">#</a><a id="no_errata_section"></a><a id="parser-no_errata_section-SOMEVALUE"></a><code>$parser-&gt;no_errata_section( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>This attribute, if set to true, will suppress generation of an errata section. The default value is false -- i.e., an errata section will be generated.</p>

</dd>
<dt id="$parser-&gt;complain_stderr(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Ecomplain_stderr(-SOMEVALUE-)">#</a><a id="complain_stderr"></a><a id="parser-complain_stderr-SOMEVALUE"></a><code>$parser-&gt;complain_stderr( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>This attribute, if set to true will send complaints to STDERR. The default value is false -- i.e., complaints do not go to STDERR.</p>

</dd>
<dt id="$parser-&gt;bare_output(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Ebare_output(-SOMEVALUE-)">#</a><a id="bare_output"></a><a id="parser-bare_output-SOMEVALUE"></a><code>$parser-&gt;bare_output( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>Some formatter subclasses use this as a flag for whether output should have prologue and epilogue code omitted. For example, setting this to true for an HTML formatter class should omit the &quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;...&lt;/title&gt;&lt;body&gt;...&quot; prologue and the &quot;&lt;/body&gt;&lt;/html&gt;&quot; epilogue.</p>

<p>If you want to set this to true, you should probably also set <code>no_whining</code> or at least <code>no_errata_section</code> to true.</p>

</dd>
<dt id="$parser-&gt;preserve_whitespace(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Epreserve_whitespace(-SOMEVALUE-)">#</a><a id="preserve_whitespace"></a><a id="parser-preserve_whitespace-SOMEVALUE"></a><code>$parser-&gt;preserve_whitespace( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>If you set this attribute to a true value, the parser will try to preserve whitespace in the output. This means that such formatting conventions as two spaces after periods will be preserved by the parser. This is primarily useful for output formats that treat whitespace as significant (such as text or *roff, but not HTML).</p>

</dd>
<dt id="$parser-&gt;parse_empty_lists(-SOMEVALUE-)"><a class="permalink" href="./Pod::Simple::Subclassing.html#$parser-%3Eparse_empty_lists(-SOMEVALUE-)">#</a><a id="parse_empty_lists"></a><a id="parser-parse_empty_lists-SOMEVALUE"></a><code>$parser-&gt;parse_empty_lists( <i>SOMEVALUE</i> )</code></dt>
<dd>

<p>If this attribute is set to true, the parser will not ignore empty <code>=over</code>/<code>=back</code> blocks. The type of <code>=over</code> will be <i>empty</i>, documented above, <a href="./Pod::Simple::Subclassing.html#events-with-an-element_name-of-over-empty">&quot;events with an element_name of over-empty&quot;</a>.</p>

</dd>
</dl>

<h1 id="SEE-ALSO"><a class="permalink" href="./Pod::Simple::Subclassing.html#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1>

<p><a href="./Pod::Simple.html">Pod::Simple</a> -- event-based Pod-parsing framework</p>

<p><a href="./Pod::Simple::Methody.html">Pod::Simple::Methody</a> -- like Pod::Simple, but each sort of event calls its own method (like <code>start_head3</code>)</p>

<p><a href="./Pod::Simple::PullParser.html">Pod::Simple::PullParser</a> -- a Pod-parsing framework like Pod::Simple, but with a token-stream interface</p>

<p><a href="./Pod::Simple::SimpleTree.html">Pod::Simple::SimpleTree</a> -- a Pod-parsing framework like Pod::Simple, but with a tree interface</p>

<p><a href="./Pod::Simple::Checker.html">Pod::Simple::Checker</a> -- a simple Pod::Simple subclass that reads documents, and then makes a plaintext report of any errors found in the document</p>

<p><a href="./Pod::Simple::DumpAsXML.html">Pod::Simple::DumpAsXML</a> -- for dumping Pod documents as tidily indented XML, showing each event on its own line</p>

<p><a href="./Pod::Simple::XMLOutStream.html">Pod::Simple::XMLOutStream</a> -- dumps a Pod document as XML (without introducing extra whitespace as Pod::Simple::DumpAsXML does).</p>

<p><a href="./Pod::Simple::DumpAsText.html">Pod::Simple::DumpAsText</a> -- for dumping Pod documents as tidily indented text, showing each event on its own line</p>

<p><a href="./Pod::Simple::LinkSection.html">Pod::Simple::LinkSection</a> -- class for objects representing the values of the TODO and TODO attributes of L&lt;...&gt; elements</p>

<p><a href="./Pod::Escapes.html">Pod::Escapes</a> -- the module that Pod::Simple uses for evaluating E&lt;...&gt; content</p>

<p><a href="./Pod::Simple::Text.html">Pod::Simple::Text</a> -- a simple plaintext formatter for Pod</p>

<p><a href="./Pod::Simple::TextContent.html">Pod::Simple::TextContent</a> -- like Pod::Simple::Text, but makes no effort for indent or wrap the text being formatted</p>

<p><a href="./Pod::Simple::HTML.html">Pod::Simple::HTML</a> -- a simple HTML formatter for Pod</p>

<p><a href="perlpod.html">perlpod</a></p>

<p><a href="perlpodspec.html">perlpodspec</a></p>

<p><a href="perldoc.html">perldoc</a></p>

<h1 id="SUPPORT"><a class="permalink" href="./Pod::Simple::Subclassing.html#SUPPORT">#</a>SUPPORT</h1>

<p>Questions or discussion about POD and Pod::Simple should be sent to the pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe.</p>

<p>This module is managed in an open GitHub repository, <a href="https://github.com/perl-pod/pod-simple/">https://github.com/perl-pod/pod-simple/</a>. Feel free to fork and contribute, or to clone <a href="git://github.com/perl-pod/pod-simple.git">git://github.com/perl-pod/pod-simple.git</a> and send patches!</p>

<p>Patches against Pod::Simple are welcome. Please send bug reports to &lt;bug-pod-simple@rt.cpan.org&gt;.</p>

<h1 id="COPYRIGHT-AND-DISCLAIMERS"><a class="permalink" href="./Pod::Simple::Subclassing.html#COPYRIGHT-AND-DISCLAIMERS">#</a><a id="COPYRIGHT"></a>COPYRIGHT AND DISCLAIMERS</h1>

<p>Copyright (c) 2002 Sean M. Burke.</p>

<p>This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p>

<p>This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.</p>

<h1 id="AUTHOR"><a class="permalink" href="./Pod::Simple::Subclassing.html#AUTHOR">#</a>AUTHOR</h1>

<p>Pod::Simple was created by Sean M. Burke &lt;sburke@cpan.org&gt;. But don&#39;t bother him, he&#39;s retired.</p>

<p>Pod::Simple is maintained by:</p>

<ul>

<li><p>Allison Randal <code>allison@perl.org</code></p>

</li>
<li><p>Hans Dieter Pearcey <code>hdp@cpan.org</code></p>

</li>
<li><p>David E. Wheeler <code>dwheeler@cpan.org</code></p>

</li>
</ul>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
